﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using System.Configuration;
using Nage.Algorithms.Solution;
using Nage.Examples.Rastrigin.Solution;
using Nage.Algorithms.Population;
using Nage.Algorithms;
using Nage.Algorithms.Evolution;
using System.Threading;
using System.Globalization;

namespace Nage.GeneticAlgorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            IUnityContainer container = new UnityContainer();
            UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
            section.Configure(container);
            SetCulture();

            IGAWrapper wrapper = container.Resolve<IGAWrapper>();
            wrapper.Solve();

            Console.Read();
        }
        
        #region SetCulture
        static void SetCulture()
        {
            var culture = new CultureInfo("en-US");
            Thread.CurrentThread.CurrentCulture = culture;
            Thread.CurrentThread.CurrentUICulture = culture;
        } 
        #endregion
    }
}
